package com.example.android.roomwordssample;
import android.arch.lifecycle.LiveData;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;

import java.util.List;



@Dao
public interface WordDao {
    //从表格中按照顺序排列
    @Query("SELECT * from word_table ORDER BY word ASC")
    LiveData<List<Word>> getAlphabetizedWords();
    @Insert (onConflict = OnConflictStrategy.IGNORE)
    void insert(Word word);
    @Query("DELETE FROM word_table")
    void deleteAll();
}
